/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sv.com.intesal.compra.sql;

/**
 *
 * @author JM
 */
public class SQLSubCategoria {

//        public static final String INSERTAR="INSERT INTO categoria(nombre_cat) VALUES (?)";
//    public static final String MODIFICAR="UPDATE categoria SET nombre_cat=? WHERE id_cat=?";
//    public static final String ELIMINAR="DELETE FROM categoria WHERE id_cat=?";
//    public static final String ALL="SELECT id_cat, nombre_cat FROM categoria";

    public static final String INSERTAR = "INSERT INTO sub_categoria(id_cat,nombre_su) VALUES (?,?)";
    public static final String MODIFICAR = "UPDATE sub_categoria SET id_cat=?, nombre_su=? WHERE id_su=?";
    public static final String ELIMINAR = "DELETE FROM sub_categoria WHERE id_su=?";
    public static final String ALL = "SELECT s.id_su, s.id_cat, s.nombre_su, c.nombre_cat FROM sub_categoria as s, categoria as c WHERE s.id_cat = c.id_cat order by c.nombre_cat,s.nombre_su";
    public static final String ALLLista = "SELECT id_cat,nombre_cat FROM categoria order by nombre_cat";
    public static final String AllCategoriaCondition = "SELECT id_su,id_cat,nombre_su FROM sub_categoria WHERE id_cat=? ";

    public static final String getSubCategorias_x_Categoria="SELECT cat.id_cat,cat.nombre_cat,sc.id_su,sc.nombre_su FROM SUB_CATEGORIA as sc,CATEGORIA as cat where cat.id_cat=sc.id_cat and cat.id_cat=? order by sc.nombre_su";

}
